package com.edu.arrayList;

import com.edu.object1.Movie;

import java.util.ArrayList;

public class arrayListDemo01 {
    //将对象存储到集合当中
    public static void main(String[] args) {
        ArrayList<Movie> list = new ArrayList<>();
        list.add(new Movie("奥特曼",123,"我"));
        list.add(new Movie("流浪地球",45,"吴京"));
        list.add(new Movie("战狼",90,"吴京"));
        System.out.println(list);//直接输出，会输出对象的地址
        for (int i = 0; i < list.size(); i++) {
            Movie movie=list.get(i);
            System.out.println(movie.getName());
            System.out.println(movie.getPrice());
            System.out.println(movie.getAvater());
            System.out.println("--------------------");
        }
    }
}
